---------------------------------------------------------------------------------------------------------
       log:  F:\data\legislative.log
  log type:  text
 opened on:   8 Jun 2006, 14:57:11

.  #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      legislative.do                                  *;
. *       Date:           1/22/05                                         *;
. *       Author:         MRG                                             *;
. *       Purpose:        Do-file to replicate results for CPS version    *;
. *                       of the number of parties paper where dependent  *;
. *                       variable is legislative parties.                *;
.   *       Input File:     legislative_new.dta                             *;
. *       Output File:    legislative.log                                 *;
. *       Data Output:    None                                            *;
. *       Previous file:                                                  *;
. *       Machine:        Office                                          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. set mem 10m;

Current memory allocation

                    current                                 memory usage
    settable          value     description                 (1M = 1024k)
    --------------------------------------------------------------------
    set maxvar         5000     max. variables allowed           1.733M
    set memory           10M    max. data space                 10.000M
    set matsize         150     max. RHS vars in models          0.184M
                                                            -----------
                                                                11.917M

. set matsize 150;

Current memory allocation

                    current                                 memory usage
    settable          value     description                 (1M = 1024k)
    --------------------------------------------------------------------
    set maxvar         5000     max. variables allowed           1.733M
    set memory           10M    max. data space                 10.000M
    set matsize         150     max. RHS vars in models          0.184M
                                                            -----------
                                                                11.917M

. use "C:\Documents and Settings\Matt Golder\My Documents\fsu\publications\cps2\legislative_new.dta", cle
> ar;

. *     ****************************************************************  *;
. *                           Summary Statistics                          *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       867     100.083    39.39866          3        199
        year |       867    1978.435    16.12735       1946       2000
     legelec |       867           1           0          1          1
    preselec |       867    .2226067    .4162364          0          1
-------------+--------------------------------------------------------
      regime |       867    .0207612    .1426664          0          1
  regime_leg |       867           0           0          0          0
    eighties |       867     .077278    .2671861          0          1
    nineties |       867    .1245675    .3304184          0          1
         old |       867    .8662053    .3406281          0          1
-------------+--------------------------------------------------------
      avemag |       843     11.2979    27.15588          1        150
   districts |       844    92.96682    141.6076          1        659
        eneg |       708    1.941652    1.227505   1.004012   14.22434
        enep |       791    3.878951    1.857447          1      14.89
 enep_others |       788    3.154099    7.559339          0       69.3
-------------+--------------------------------------------------------
       enep1 |       788    4.273211    3.811859          1      57.56
        enpp |       826    3.573923    3.853006          1      52.42
 enpp_others |       815    1.599509    6.055805          0         86
       enpp1 |       814    3.934066    7.452793          1     178.65
      enpres |       858    1.186659    1.595493          0       6.57
-------------+--------------------------------------------------------
      medmag |       702    12.72009    29.69172          1        150
      newdem |       867    .1534025    .3605831          0          1
  proximity1 |       867    .2918454    .4175579          0          1
  proximity2 |       867    .2214533    .4154646          0          1
       seats |       860     201.943    163.7675         10        672
-------------+--------------------------------------------------------
  upperseats |       817    14.89229    45.95744          0        344
   uppertier |       817    5.632791    12.65088          0      77.95
twoelections |       867    .0207612    .1426664          0          1
twoelectio~1 |       867    .0103806    .1014136          0          1

. *     ****************************************************************  *;
. *                    Relabel and Define Variables                       *;
. *     ****************************************************************  *;
. label var country  "countryname";

. label var newdem "first election as new democracy";

. label var countrynumber "countrynumber";

. label var year "year";

. label var regime "regime as of 31 December of given year 0=democracy 1=dictatorship";

. label var regime_leg "regime type at time of legislative election 0 = democracy 1=dictatorship";

. label var legelec "legislative election";

. label var preselec "presidential election";

. label var eighties "election in 1980s closest to 1985";

. label var old "elections in countries that did not transition to democracy in 1990s";

. label var nineties "elections in 1990s closest to 1995";

. label var proximity1 "proximity - continuous";

. label var proximity2 "proximity - dichotomous";

. label var enpp "parliamentary parties - uncorrected";

. label var enpp1 "parliamentary parties - corrected";

. label var enep "electoral parties - uncorrected";

. label var enep1 "electoral parties - corrected";

. label var enpres "effective number of presidential candidates";

. label var seats "assembly size";

. label var districts "number of electoral districts";

. label var avemag "average district magnitude";

. label var medmag "median district magnitude";

. label var upperseats "number of uppertier seats";

. label var uppertier "percentage of uppertier seats";

. label var eneg "effective number of ethnic groups  fearon";

. describe;

Contains data from C:\Documents and Settings\Matt Golder\My Documents\fsu\publications\cps2\legislative_n
> ew.dta
  obs:           867                          
 vars:            29                          16 Dec 2003 17:44
 size:        90,168 (99.1% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
country         str31  %31s                   countryname
countrynumber   int    %8.0g                  countrynumber
year            int    %8.0g                  year
legelec         byte   %8.0g                  legislative election
preselec        byte   %8.0g                  presidential election
regime          byte   %8.0g                  regime as of 31 December of
                                                given year 0=democracy
                                                1=dictatorship
regime_leg      byte   %8.0g                  regime type at time of
                                                legislative election 0 =
                                                democracy 1=dictatorship
eighties        byte   %8.0g                  election in 1980s closest to
                                                1985
nineties        byte   %8.0g                  elections in 1990s closest to
                                                1995
old             byte   %8.0g                  elections in countries that did
                                                not transition to democracy in
                                                1990s
avemag          float  %9.0g                  average district magnitude
districts       int    %8.0g                  number of electoral districts
eneg            float  %9.0g                  effective number of ethnic
                                                groups  fearon
enep            float  %9.0g                  electoral parties - uncorrected
enep_others     float  %9.0g                  
enep1           float  %9.0g                  electoral parties - corrected
enpp            float  %9.0g                  parliamentary parties -
                                                uncorrected
enpp_others     float  %9.0g                  
enpp1           float  %9.0g                  parliamentary parties -
                                                corrected
enpres          float  %9.0g                  effective number of
                                                presidential candidates
medmag          float  %9.0g                  median district magnitude
newdem          byte   %8.0g                  first election as new democracy
proximity1      float  %9.0g                  proximity - continuous
proximity2      byte   %8.0g                  proximity - dichotomous
seats           int    %8.0g                  assembly size
upperseats      int    %8.0g                  number of uppertier seats
uppertier       float  %9.0g                  percentage of uppertier seats
twoelections    byte   %8.0g                  
twoelections1   byte   %8.0g                  
-------------------------------------------------------------------------------
Sorted by:  

. *     ****************************************************************  *;
. *       Need to drop countries that have no formal parties              *;
. *       since I am interested in determining the number of parties.     *;
. *       Drop Kiribati, Marshall Islands, Micronesia, Nauru, Palau,      *;
. *       Lebanon (at least no votes by party), Kyrgzstan.                *;
. *       Since I am interested in competitive elections I drop the       *;
. *       elections that occurred in Colombia between 1958 and 1970 due   *;
. *       to a constitutional agreement to share power between the        *;
. *       conservative and liberal parties.                               *;
. *       Also drop the Congolese elections of 1963.  Although there were *;
. *       multiple parties permitted, all candidates ran on a single list.*;
. *       Thus, there was no actual competition in this election.         *;
. *     ****************************************************************  *;
. drop if countrynumber==163;
(6 observations deleted)

. drop if countrynumber==165;
(2 observations deleted)

. drop if countrynumber==197;
(3 observations deleted)

. drop if countrynumber==189;
(5 observations deleted)

. drop if countrynumber==146;
(12 observations deleted)

. drop if countrynumber==198;
(2 observations deleted)

. drop if countrynumber==167;
(8 observations deleted)

. drop if countrynumber==70 & year==1958;
(1 observation deleted)

. drop if countrynumber==70 & year==1960;
(1 observation deleted)

. drop if countrynumber==70 & year==1962;
(1 observation deleted)

. drop if countrynumber==70 & year==1964;
(1 observation deleted)

. drop if countrynumber==70 & year==1966;
(1 observation deleted)

. drop if countrynumber==70 & year==1968;
(1 observation deleted)

. drop if countrynumber==70 & year==1970;
(1 observation deleted)

. drop if countrynumber==12 & year==1963;
(1 observation deleted)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       821     97.3715    37.35025          3        199
        year |       821     1978.35    16.15197       1946       2000
     legelec |       821           1           0          1          1
    preselec |       821    .2180268    .4131574          0          1
-------------+--------------------------------------------------------
      regime |       821    .0207065    .1424866          0          1
  regime_leg |       821           0           0          0          0
    eighties |       821    .0791717    .2701712          0          1
    nineties |       821    .1242387    .3300548          0          1
         old |       821    .8733252    .3328111          0          1
-------------+--------------------------------------------------------
      avemag |       804    11.72699    27.73206          1        150
   districts |       805    96.60373    143.9838          1        659
        eneg |       690    1.889245    1.181049   1.004012   14.22434
        enep |       782    3.878018    1.860428       1.23      14.89
 enep_others |       779    3.171412    7.596386          0       69.3
-------------+--------------------------------------------------------
       enep1 |       779    4.276418    3.829688       1.23      57.56
        enpp |       808     3.23625    1.470687          1      10.87
 enpp_others |       797    1.440527    4.762796          0       54.1
       enpp1 |       796    3.322802    1.756047          1      20.94
      enpres |       815     1.21214    1.616311          0       6.57
-------------+--------------------------------------------------------
      medmag |       664    13.30422    30.42178          1        150
      newdem |       821    .1534714     .360661          0          1
  proximity1 |       821    .2911449    .4150291          0          1
  proximity2 |       821    .2168088    .4123225          0          1
       seats |       814    210.0037    164.1061         11        672
-------------+--------------------------------------------------------
  upperseats |       778    15.61954    46.97577          0        344
   uppertier |       778    5.883021    12.88335          0      77.95
twoelections |       821    .0219245    .1465263          0          1
twoelectio~1 |       821    .0109622    .1041887          0          1

. *     ****************************************************************  *;
. *       Does it matter if I use avemag instead of medmag?               *;
. *     ****************************************************************  *;
. correlate avemag medmag;
(obs=664)

             |   avemag   medmag
-------------+------------------
      avemag |   1.0000
      medmag |   0.9981   1.0000


. correlate avemag medmag if avemag~=1;
(obs=373)

             |   avemag   medmag
-------------+------------------
      avemag |   1.0000
      medmag |   0.9981   1.0000


. *     ****************************************************************  *;
. *       Correlation is extremely high in both cases i.e. greater than   *;
. *       99%.                                                            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Generate interaction variables ready for regressions.           *;
. *     ****************************************************************  *;
. generate logmag=ln(avemag);
(17 missing values generated)

. generate enep_logmag = enep1*logmag;
(51 missing values generated)

. generate enep_uppertier = enep1*uppertier;
(81 missing values generated)

. *     ****************************************************************  *;
. *           Now drop countries with majoritarian uppertiers             *;
. *     ****************************************************************  *;
. drop if countrynumber==132;
(5 observations deleted)

. drop if countrynumber==29;
(7 observations deleted)

. drop if countrynumber==87 & year==1988;
(1 observation deleted)

. drop if countrynumber==87 & year==1992;
(1 observation deleted)

. drop if countrynumber==87 & year==1996;
(1 observation deleted)

. drop if countrynumber==116 & year==1987;
(1 observation deleted)

. drop if countrynumber==116 & year==1996;
(1 observation deleted)

. *     ****************************************************************  *;
. *       Drop those countries where enep1 or enpp1 others are greater    *;
. *       than 15% of the vote or seats. Lose 32 observations             *;
. *     ****************************************************************  *;
. list country year if enep_others>15 & enep_others<100;

     +----------------------------+
     |             country   year |
     |----------------------------|
 16. |           Argentina   1962 |
109. |               Benin   1999 |
169. |            Colombia   1998 |
236. |             Ecuador   1952 |
237. |             Ecuador   1954 |
     |----------------------------|
364. |               India   1952 |
365. |               India   1957 |
374. |               India   1996 |
450. | Korea, South (Rep.)   1960 |
478. |                Mali   1997 |
     |----------------------------|
538. |             Nigeria   1979 |
555. |            Pakistan   1988 |
558. |            Pakistan   1997 |
599. |              Russia   1993 |
600. |              Russia   1995 |
     |----------------------------|
601. |              Russia   1999 |
607. |        Sierra Leone   1962 |
608. |        Sierra Leone   1967 |
615. |     Solomon Islands   1980 |
616. |     Solomon Islands   1984 |
     |----------------------------|
617. |     Solomon Islands   1993 |
723. |             Ukraine   1994 |
724. |             Ukraine   1998 |
781. |             Vanuatu   1998 |
     +----------------------------+

. list country year if enpp_others>15 & enpp_others<100;

     +----------------------------+
     |             country   year |
     |----------------------------|
  4. |             Andorra   1993 |
 29. |             Armenia   1995 |
109. |               Benin   1999 |
119. |              Brazil   1958 |
120. |              Brazil   1962 |
     |----------------------------|
170. |             Comoros   1992 |
450. | Korea, South (Rep.)   1960 |
474. |          Madagascar   1998 |
555. |            Pakistan   1988 |
599. |              Russia   1993 |
     |----------------------------|
600. |              Russia   1995 |
601. |              Russia   1999 |
607. |        Sierra Leone   1962 |
615. |     Solomon Islands   1980 |
616. |     Solomon Islands   1984 |
     |----------------------------|
618. |     Solomon Islands   1997 |
620. |             Somalia   1969 |
723. |             Ukraine   1994 |
724. |             Ukraine   1998 |
     +----------------------------+

. drop if enep_others>15 & enep_others<100;
(24 observations deleted)

. drop if enpp_others>15 & enpp_others<100;
(8 observations deleted)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       772    97.87176    36.13184          3        199
        year |       772    1977.978    16.16551       1946       2000
     legelec |       772           1           0          1          1
    preselec |       772    .2215026    .4155272          0          1
-------------+--------------------------------------------------------
      regime |       772    .0181347    .1335251          0          1
  regime_leg |       772           0           0          0          0
    eighties |       772    .0777202    .2679044          0          1
    nineties |       772    .1204663    .3257171          0          1
         old |       772    .8795337    .3257171          0          1
-------------+--------------------------------------------------------
      avemag |       757    12.30737    28.47144          1        150
   districts |       758    94.70053    144.2441          1        659
        eneg |       655    1.838161    1.136721   1.004012   14.22434
        enep |       737    3.864125    1.814272       1.23      13.86
 enep_others |       734    1.875191    2.659583          0       14.7
-------------+--------------------------------------------------------
       enep1 |       734    3.887745    1.830021       1.23     14.125
        enpp |       762    3.225459    1.470193          1      10.87
 enpp_others |       751    .6745672    1.900724          0         13
       enpp1 |       750    3.235427    1.478884          1      10.87
      enpres |       766    1.203112     1.60857          0       6.57
-------------+--------------------------------------------------------
      medmag |       621    14.09501    31.30262          1        150
      newdem |       772    .1437824    .3510964          0          1
  proximity1 |       772    .2930052    .4172046          0          1
  proximity2 |       772    .2202073     .414655          0          1
       seats |       767    211.0169    164.4517         11        672
-------------+--------------------------------------------------------
  upperseats |       729    14.88477    45.76211          0        344
   uppertier |       729      5.5969    12.65192          0      77.95
twoelections |       772    .0233161    .1510032          0          1
twoelectio~1 |       772     .011658    .1074107          0          1
      logmag |       757    1.401342    1.316898          0   5.010635
-------------+--------------------------------------------------------
 enep_logmag |       727     6.20017    6.910248          0   48.42548
enep_upper~r |       695    25.49334    60.36052          0   423.1264

. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *        So, now let's run stuff- Here are results for Table 1          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                 Run model for the 1990s our data                      *;
. *     ****************************************************************  *;
. regress enpp1 enep1 logmag enep_logmag uppertier enep_uppertier if nineties==1;

      Source |       SS       df       MS              Number of obs =      81
-------------+------------------------------           F(  5,    75) =   46.27
       Model |  126.381416     5  25.2762833           Prob > F      =  0.0000
    Residual |  40.9719936    75  .546293248           R-squared     =  0.7552
-------------+------------------------------           Adj R-squared =  0.7389
       Total |   167.35341    80  2.09191763           Root MSE      =  .73912

------------------------------------------------------------------------------
       enpp1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       enep1 |   .3918515   .0749165     5.23   0.000     .2426102    .5410928
      logmag |  -.1441387   .1548389    -0.93   0.355    -.4525936    .1643162
 enep_logmag |   .0945485   .0361877     2.61   0.011     .0224589    .1666381
   uppertier |   .0188137   .0135315     1.39   0.169    -.0081424    .0457698
enep_upper~r |  -.0033421   .0030521    -1.10   0.277    -.0094223    .0027381
       _cons |   1.196661   .2944592     4.06   0.000     .6100684    1.783254
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *      Run model for the 1990s established democracies only - our data  *;
. *     ****************************************************************  *;
. regress enpp1 enep1 logmag enep_logmag uppertier enep_uppertier if nineties==1 & old==1;

      Source |       SS       df       MS              Number of obs =      54
-------------+------------------------------           F(  5,    48) =   52.78
       Model |  87.0180363     5  17.4036073           Prob > F      =  0.0000
    Residual |  15.8260441    48  .329709252           R-squared     =  0.8461
-------------+------------------------------           Adj R-squared =  0.8301
       Total |   102.84408    53  1.94045435           Root MSE      =   .5742

------------------------------------------------------------------------------
       enpp1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       enep1 |   .4581557   .0739808     6.19   0.000     .3094073    .6069042
      logmag |  -.2561122   .1866345    -1.37   0.176    -.6313661    .1191416
 enep_logmag |   .1293241   .0398929     3.24   0.002     .0491139    .2095342
   uppertier |  -.0123837   .0230944    -0.54   0.594    -.0588181    .0340507
enep_upper~r |   .0067912   .0052659     1.29   0.203    -.0037966    .0173789
       _cons |   .8974633   .2921994     3.07   0.004     .3099571    1.484969
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *                           Pooled analysis                             *;
. *     ****************************************************************  *;
. regress enpp1 enep1 logmag enep_logmag uppertier enep_uppertier, robust cluster(country);

Linear regression                                      Number of obs =     680
                                                       F(  5,   100) =  202.91
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.8510
Number of clusters (country) = 101                     Root MSE      =  .54196

------------------------------------------------------------------------------
             |               Robust
       enpp1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       enep1 |   .6096102   .0579028    10.53   0.000     .4947328    .7244877
      logmag |  -.0238867   .0583971    -0.41   0.683    -.1397448    .0919714
 enep_logmag |   .0533666   .0182633     2.92   0.004     .0171328    .0896004
   uppertier |   .0216956   .0094291     2.30   0.023     .0029887    .0404026
enep_upper~r |  -.0039215   .0027452    -1.43   0.156     -.009368    .0015249
       _cons |   .5232036   .1695775     3.09   0.003     .1867666    .8596406
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *                   Pooled analysis - established democracies           *;
. *     ****************************************************************  *;
. regress enpp1 enep1 logmag enep_logmag uppertier enep_uppertier if old==1, robust cluster(country);

Linear regression                                      Number of obs =     604
                                                       F(  5,    65) =  218.32
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.8805
Number of clusters (country) = 66                      Root MSE      =  .46585

------------------------------------------------------------------------------
             |               Robust
       enpp1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       enep1 |   .6325436   .0553028    11.44   0.000     .5220963    .7429908
      logmag |  -.0394984   .0552338    -0.72   0.477    -.1498079     .070811
 enep_logmag |   .0562864   .0178251     3.16   0.002     .0206872    .0918857
   uppertier |    .008373   .0119956     0.70   0.488    -.0155839    .0323298
enep_upper~r |   .0006981   .0032323     0.22   0.830    -.0057572    .0071533
       _cons |   .4587837   .1591034     2.88   0.005     .1410324     .776535
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *       So, we have replicated all of the results in Table 1 of the     *;
. *       article.                                                        *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Need to show how I calculated standard errors and confidence    *;
. *       intervals for marginal effect of electoral parties.             *;
. *       The marginal effect of electoral parties when UppertierSeats=0  *;
. *       and ln(magnitude)=0 is 0.63 [0.52, 0.74].                       *;
. *       The marginal effect of electoral parties when UppertierSeats=0  *;
. *       and ln(magnitude)=4.79 is 0.90 [0.81, 0.99].                    *;
. *     ****************************************************************  *;
. regress enpp1 enep1 logmag enep_logmag uppertier enep_uppertier if old==1, robust cluster(country);

Linear regression                                      Number of obs =     604
                                                       F(  5,    65) =  218.32
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.8805
Number of clusters (country) = 66                      Root MSE      =  .46585

------------------------------------------------------------------------------
             |               Robust
       enpp1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       enep1 |   .6325436   .0553028    11.44   0.000     .5220963    .7429908
      logmag |  -.0394984   .0552338    -0.72   0.477    -.1498079     .070811
 enep_logmag |   .0562864   .0178251     3.16   0.002     .0206872    .0918857
   uppertier |    .008373   .0119956     0.70   0.488    -.0155839    .0323298
enep_upper~r |   .0006981   .0032323     0.22   0.830    -.0057572    .0071533
       _cons |   .4587837   .1591034     2.88   0.005     .1410324     .776535
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. gen conb=b1+b3*4.79;

. display conb;
.90215552

. gen conse=sqrt(varb1+varb3*4.79^2+2*covb1b3*4.79);

. display conse;
.04677826

. gen a=1.96*conse;

. gen top=conb+a;

. gen bottom=conb-a;

. display top bottom;
.99384093.8104701

. drop conb conse a top bottom;

.  *     ****************************************************************  *;
. *          Now time to do panel analysis with xtpcse                    *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       First, I need to drop one election from those countries that    *;
. *       have two elections in the same year because we can't have       *;
. *       repeated time values within panel. Drops 18 observations.       *;
. *     ****************************************************************  *;
. replace year=. if twoelections1==1;
(9 real changes made, 9 to missing)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       772    97.87176    36.13184          3        199
        year |       763    1977.991    16.17721       1946       2000
     legelec |       772           1           0          1          1
    preselec |       772    .2215026    .4155272          0          1
-------------+--------------------------------------------------------
      regime |       772    .0181347    .1335251          0          1
  regime_leg |       772           0           0          0          0
    eighties |       772    .0777202    .2679044          0          1
    nineties |       772    .1204663    .3257171          0          1
         old |       772    .8795337    .3257171          0          1
-------------+--------------------------------------------------------
      avemag |       757    12.30737    28.47144          1        150
   districts |       758    94.70053    144.2441          1        659
        eneg |       655    1.838161    1.136721   1.004012   14.22434
        enep |       737    3.864125    1.814272       1.23      13.86
 enep_others |       734    1.875191    2.659583          0       14.7
-------------+--------------------------------------------------------
       enep1 |       734    3.887745    1.830021       1.23     14.125
        enpp |       762    3.225459    1.470193          1      10.87
 enpp_others |       751    .6745672    1.900724          0         13
       enpp1 |       750    3.235427    1.478884          1      10.87
      enpres |       766    1.203112     1.60857          0       6.57
-------------+--------------------------------------------------------
      medmag |       621    14.09501    31.30262          1        150
      newdem |       772    .1437824    .3510964          0          1
  proximity1 |       772    .2930052    .4172046          0          1
  proximity2 |       772    .2202073     .414655          0          1
       seats |       767    211.0169    164.4517         11        672
-------------+--------------------------------------------------------
  upperseats |       729    14.88477    45.76211          0        344
   uppertier |       729      5.5969    12.65192          0      77.95
twoelections |       772    .0233161    .1510032          0          1
twoelectio~1 |       772     .011658    .1074107          0          1
      logmag |       757    1.401342    1.316898          0   5.010635
-------------+--------------------------------------------------------
 enep_logmag |       727     6.20017    6.910248          0   48.42548
enep_upper~r |       695    25.49334    60.36052          0   423.1264

. *     ****************************************************************  *;
. *       Now I need to tsset the data.                                   *;
. *     ****************************************************************  *;
. tsset countrynumber year, yearly;
       panel variable:  countrynumber, 3 to 199
        time variable:  year, 1946 to 2000, but with gaps

. *     ****************************************************************  *;
. *                         XTPCSE                                        *;
. *     ****************************************************************  *;
. xtpcse enpp1 enep1 logmag enep_logmag uppertier enep_uppertier, pairwise;

Number of gaps in sample:  546
(note: at least one disturbance covariance assumed 0, no common time periods
       between panels)

Linear regression, correlated panels corrected standard errors (PCSEs)

Group variable:   countrynumber                 Number of obs      =       672
Time variable:    year                          Number of groups   =       101
Panels:           correlated (unbalanced)       Obs per group: min =         1
Autocorrelation:  no autocorrelation                           avg =  6.653465
Sigma computed by pairwise selection                           max =        28
Estimated covariances      =      5151          R-squared          =    0.8508
Estimated autocorrelations =         0          Wald chi2(5)       =   3537.42
Estimated coefficients     =         6          Prob > chi2        =    0.0000

------------------------------------------------------------------------------
             |           Panel-corrected
       enpp1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       enep1 |   .6038361   .0295932    20.40   0.000     .5458345    .6618377
      logmag |  -.0281507   .0387693    -0.73   0.468     -.104137    .0478357
 enep_logmag |   .0550226   .0104694     5.26   0.000      .034503    .0755422
   uppertier |   .0211732    .005527     3.83   0.000     .0103406    .0320058
enep_upper~r |  -.0037736   .0013594    -2.78   0.006     -.006438   -.0011092
       _cons |   .5376068   .0872093     6.16   0.000     .3666798    .7085339
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *               XTPCSE - established democracies only                   *;
. *     ****************************************************************  *;
. xtpcse enpp1 enep1 logmag enep_logmag uppertier enep_uppertier if old==1, pairwise;

Number of gaps in sample:  507
(note: at least one disturbance covariance assumed 0, no common time periods
       between panels)

Linear regression, correlated panels corrected standard errors (PCSEs)

Group variable:   countrynumber                 Number of obs      =       596
Time variable:    year                          Number of groups   =        66
Panels:           correlated (unbalanced)       Obs per group: min =         1
Autocorrelation:  no autocorrelation                           avg =  9.030303
Sigma computed by pairwise selection                           max =        28
Estimated covariances      =      2211          R-squared          =    0.8802
Estimated autocorrelations =         0          Wald chi2(5)       =   5988.76
Estimated coefficients     =         6          Prob > chi2        =    0.0000

------------------------------------------------------------------------------
             |           Panel-corrected
       enpp1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       enep1 |   .6266667    .024129    25.97   0.000     .5793747    .6739586
      logmag |  -.0430832    .032317    -1.33   0.182    -.1064232    .0202569
 enep_logmag |   .0577745   .0085463     6.76   0.000     .0410241    .0745249
   uppertier |   .0077512   .0070178     1.10   0.269    -.0060033    .0215058
enep_upper~r |   .0008758   .0018569     0.47   0.637    -.0027636    .0045152
       _cons |    .473496    .062913     7.53   0.000     .3501887    .5968033
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *       Need to show how I calculated standard errors and confidence    *;
. *       intervals for marginal effect of electoral parties.             *;
. *       The marginal effect of electoral parties when UppertierSeats=0  *;
. *       and ln(magnitude)=0 is 0.63 [0.58, 0.67].                       *;
. *       The marginal effect of electoral parties when UppertierSeats=0  *;
. *       and ln(magnitude)=5.01 is 0.92 [0.85, 0.98].                    *;
. *     ****************************************************************  *;
. xtpcse enpp1 enep1 logmag enep_logmag uppertier enep_uppertier if old==1, pairwise;

Number of gaps in sample:  507
(note: at least one disturbance covariance assumed 0, no common time periods
       between panels)

Linear regression, correlated panels corrected standard errors (PCSEs)

Group variable:   countrynumber                 Number of obs      =       596
Time variable:    year                          Number of groups   =        66
Panels:           correlated (unbalanced)       Obs per group: min =         1
Autocorrelation:  no autocorrelation                           avg =  9.030303
Sigma computed by pairwise selection                           max =        28
Estimated covariances      =      2211          R-squared          =    0.8802
Estimated autocorrelations =         0          Wald chi2(5)       =   5988.76
Estimated coefficients     =         6          Prob > chi2        =    0.0000

------------------------------------------------------------------------------
             |           Panel-corrected
       enpp1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       enep1 |   .6266667    .024129    25.97   0.000     .5793747    .6739586
      logmag |  -.0430832    .032317    -1.33   0.182    -.1064232    .0202569
 enep_logmag |   .0577745   .0085463     6.76   0.000     .0410241    .0745249
   uppertier |   .0077512   .0070178     1.10   0.269    -.0060033    .0215058
enep_upper~r |   .0008758   .0018569     0.47   0.637    -.0027636    .0045152
       _cons |    .473496    .062913     7.53   0.000     .3501887    .5968033
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. gen conb=b1+b3*5.01;

. display conb;
.91611689

. gen conse=sqrt(varb1+varb3*5.01^2+2*covb1b3*5.01);

. display conse;
.03482218

. gen a=1.96*conse;

. gen top=conb+a;

. gen bottom=conb-a;

. display top bottom;
.98436838.8478654

.               *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                                   THE END                             *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. exit;

end of do-file

.  log close
       log:  F:\data\legislative.log
  log type:  text
 closed on:   8 Jun 2006, 14:58:20
---------------------------------------------------------------------------------------------------------
